function restoreColor(tclist){
     if(tclist!=null){
        tcarr = tclist.split(';');
        for(var i = 0; i < tcarr.length;i++){
             tc = tcarr[i].split('.');
            colorChange(tc[0],tc[1])
        }
     }
     if(lasttclist!=null){
        allColor(lasttclist,'white');
     }
}

function colorChange(id,color){
    var e = document.getElementById(id);
    var s = replaceStyleAttr(e.getAttribute('style'),'stroke',color);
    document.getElementById('svg').appendChild(e);
    e.setAttribute('style',s);
}


function replaceStyleAttr(str,value,attr){
    var v = str.split(';');
    for(var i = 0; i < v.length;i++){
        if(v[i].indexOf(value+":") == 0 ){
            v[i]=value+":"+attr;
        }
    }
    return v.join(';');
}
                                                        //object contains links,colors
var lasttclist = null;
function mouseClickProph(sourceverses,destverses,tclist){
    var temp = lasttclist;
    lasttclist = tclist;
    restoreColor(temp);
    //ot nt
    var e = document.getElementById('ot');
    e.firstChild.nodeValue = sourceverses;

    e = document.getElementById('nt');
    e.firstChild.nodeValue = destverses;
     
}


function allColor(tclist,color){
     tcarr = tclist.split(';');
     for(var i = 0; i < tcarr.length;i++){
        
         tc = tcarr[i].split('.');
         colorChange(tc[0],color)
     }
     alert(1)
}







/*function colorChange(id,color){
	var e = document.getElementById(id);
	var s = replaceStyleAttr(e.getAttribute('style'),'stroke',color);
	e.setAttribute('style',s);
}

function replaceStyleAttr(str,value,attr){
	var v = str.split(';');
	for(var i = 0; i < v.length;i++){
		if(v[i].indexOf(value+":") == 0 ){
			v[i]=value+":"+attr;
		}
	}
	return v.join(';');
}
//object contains links,colors
function mouseOverProph(id,obj,divid){

}

function mouseOutProph(id,obj,divid){

}
function mouseClickProph(id,sourceverses,destverses){

}
function bibleGatewaySearch(verse){
//http://www.biblegateway.com/passage/?search=John%201:1-40&version=NIV
}

function allColor(tclist,color){
    tcarr = tclist.split(';');
    for(var i = 0; i < tcarr.length;i++){
        tc = tclist[i].split(':');
        colorChange(tc[0],color)
    }
}

function restoreColor(tclist){
    tcarr = tclist.split(';');
    for(var i = 0; i < tcarr.length;i++){
        tc = tclist[i].split(':');
        colorChange(tc[0],tc[1])
    }
}

*/

